package com.iwhalecloud.bss.kite.cucc.service.attr.handler;

import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.common.constant.LocalKeyConsts;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.attr.handler.AbstractAttrHandler;
import com.ztesoft.bss.common.util.ContextUtil;

/**
 * A、Z端接入方式
 * */
public class AZAccessMethodAttrHandler extends AbstractAttrHandler {

    @Override
    public void after(KiteAttr attr, KiteInst inst, AttrData data) {
        //河南个性化 A、Z端接入方式下拉值包含：MSTP（1_0000351）、OTN（100002888）,非河南去掉，默认包含
        String provinceCode = ContextUtil.getLoginInfo().getUserInfo().getPostProvinceNbr();
        if(!LocalKeyConsts.PROVINCE_HENAN.equals(provinceCode)){
            attr.getAttrValues().removeIf(targetAttr -> KiteStringUtils.equals(targetAttr.getAttrValue(), "1_0000351"));
            attr.getAttrValues().removeIf(targetAttr -> KiteStringUtils.equals(targetAttr.getAttrValue(), "100002888"));
        }
        super.after(attr, inst, data);
    }
}
